<?php
//dezend by http://www.yunlu99.com/ QQ:270656184
defined('BASEPATH') || exit('No direct script access allowed');
?>
<div class="user-body">
  	<div class="body-content">
	<div class="form">
			
			<?php
if (isset($pic_apply) && ($pic_apply['status'] == 0)) {
?>			<h3 style="margin:30px;padding:30px;border:1px dashed #ccc;text-align:center;"><?php echo lang('user_pic_notice');?></h3>
			<?php
}
else {
?>			<?php
	if (isset($pic_apply) && ($pic_apply['status'] == 2)) {
?>			<p class="warning" style="text-align:center;padding:5px;border:1px dashed #ccc;"><?php echo lang('user_pic_result');?>：<?php echo $pic_apply['info'] ? $pic_apply['info'] : lang('user_pic_nopass');?></p>
	        <?php
	}

?>	        <div class="warning notice" style="margin-bottom:30px;">
				<strong><?php echo lang('user_pic_term_1');?></strong>
				<p><?php echo lang('user_pic_term_2');?></p>
				<p><?php echo lang('user_pic_term_3');?></p>
			</div>
	        <form id="form_id" action="<?php echo site_url('safe/pic_do');?>" method="post">
	        	<table style="margin-left:0px;">
				<tr>
			    <th width=50 style="text-align:left;"><?php echo lang('user_name');?></th>
			    <td><input type="text" name="name"><p><?php echo lang('user_name_warn');?></p></td>
				</tr>
				<tr>
		            <th style="text-align:left;"><?php echo lang('user_area');?></th>
				    <td>
					    <select name="area_code_idno">
					    	
<?php
	foreach ($area as $v) {
?>					    	<option value="<?php echo $v['code'];?>" 
<?php
		if ($v['is_default'] == 1) {
?>selected<?php
		}

?>><?php echo $v['name'];?></option>
					    	<?php
	}

?>					    </select>
					    <p><?php echo lang('user_area_warn');?></p>
				    </td>
				</tr>
				<tr>
		            <th style="text-align:left;"><?php echo lang('user_idtype');?></th>
				    <td>
					    <select name="idtype">
					    	<option value="0">身份证</option>
					    	<option value="1">护照</option>
					    	<option value="2">通行证</option>
					    </select>
				    </td>
				</tr>
				<tr>
			    <th style="text-align:left;"><?php echo lang('user_idno');?></th>
			    <td><input type="text" name="idno"><p><?php echo lang('user_idno_warn');?></p></td>
				</tr>
			  </table>
			  <table cellspacing=10 cellpadding=0 border=0 class="pic1" style="width:500px;margin-left:0px;">
				
				<tr>
					<td valign=bottom>
						<div id="pic_front_view" class="upload_view"></div>
						<input type="hidden" name="pic_front" id="pic_front_value">
						<input type="file" id="pic_front">
					</td>
				</tr>
				<tr>
					<td valign=bottom>
						<div id="pic_back_view" class="upload_view"></div>
						<input type="hidden" name="pic_back" id="pic_back_value">
						<input type="file" id="pic_back">
					</td>
				</tr>
				<tr>
					<td valign=bottom>
						<div id="pic_hand_view" class="upload_view"></div>
						<input type="hidden" name="pic_hand" id="pic_hand_value">
						<input type="file" id="pic_hand">
					</td>
				</tr>
				<tr><th colspan=3 style="text-align:left;" class="warning"></th></tr>
				<tr><th colspan=3 style="text-align:left;"><button type="submit"><?php echo lang('user_submit');?></button></th></tr>
			    </table>
			</form>
			<?php
}

?>			
	</div>
	</div>
  </div>
  <div class="clear"></div>
</div>
<script>
$(function(){
	$('#form_id').winForm();
	$("#pic_front").upload('<?php echo site_url('safe/upload');?>','/upload/user/', '<?php echo lang('user_pic_front_warn');?>');
	$("#pic_back").upload('<?php echo site_url('safe/upload');?>','/upload/user/', '<?php echo lang('user_pic_back_warn');?>');
	$("#pic_hand").upload('<?php echo site_url('safe/upload');?>','/upload/user/', '<?php echo lang('user_pic_hand_warn');?>');
	
});
</script>